package io.read;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @Package javaSE.io.read
 * @Author shimmer
 * @Date 2020/5/27 21:31
 * @TODO 从控制台读取多字符输入
 */
public class BRRead {
    public static void main(String[] args) {
        try {
            read();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void read() throws IOException {
        char c;
        //为了获得最高的效率，请考虑将InputStreamReader包装在BufferedReader中。
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        System.out.println("输入q时退出");
        do {
            c = (char) bf.read();
            System.out.println(c);
        } while (c != 'q');
    }
}
